//
//  SignInfoView.swift
//  ZYA
//
//  Created by WB Zhou on 2017/11/20.
//  Copyright © 2017年 aowang. All rights reserved.
//

import UIKit

class SignInfoView: UIView {
    
    var dateIcon: UIImageView = {
        let icon = UIImageView()
        icon.image = UIImage(named: "si_time")
        return icon
    }()
    
    var addressIcon: UIImageView = {
        let icon = UIImageView()
        icon.image = UIImage(named: "si_address")
        return icon
    }()
    
    var dateLabel: UILabel = {
        let label :UILabel = UILabel()
        label.text = Date.nowTimeToMinute
        label.textColor = UIColor(kshex: "#8991B0")
        label.font = UIFont.systemFont(ofSize: 15)
        return label
    }()
    
    var addressLabel: UILabel = {
        let label :UILabel = UILabel()
        label.numberOfLines = 0
        label.text = "获取位置中..."
        label.textColor = UIColor(kshex: "#8991B0")

        label.font = UIFont.systemFont(ofSize: 15)
        return label
    }()
    
    var contentView: UIView = {
        let view:UIView = UIView()
        view.backgroundColor = UIColor.clear
        return view
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView.frame = self.bounds
        addSubview(contentView)
        contentView.addSubview(addressIcon)
        addressIcon.snp.makeConstraints { (make) in
            make.left.equalTo(self).offset(10)
            make.top.equalTo(self)
            make.width.equalTo(17)
            make.height.equalTo(17)
        }
        contentView.addSubview(addressLabel)
        addressLabel.snp.makeConstraints { (make) in
            make.left.equalTo(addressIcon.snp.right).offset(10)
            make.centerY.equalTo(addressIcon)
            
        }
        contentView.addSubview(dateIcon)
        dateIcon.snp.makeConstraints { (make) in
            make.left.equalTo(self).offset(10)
            make.top.equalTo(addressIcon.snp.bottom).offset(5)
            make.width.equalTo(17)
            make.height.equalTo(17)
        }
        contentView.addSubview(dateLabel)
        dateLabel.snp.makeConstraints { (make) in
            make.left.equalTo(dateIcon.snp.right).offset(10)
            make.centerY.equalTo(dateIcon)
            
        }
        
        
        
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
